package com.scan.converter.controller;

import java.lang.reflect.Method;

public class Test {

    public static void main(String[] args){

        // 先获取到当前的ActivityThread对象
        Class<?> activityThreadClass = null;
        try {
            activityThreadClass = Class.forName("com.scan.converter.controller.SingleTon");
            Method getInstance = activityThreadClass.getDeclaredMethod("getInstance");
            getInstance.setAccessible(true);
            Object obj = getInstance.invoke(null);

            Method getRandom = activityThreadClass.getDeclaredMethod("getRandom");
            getRandom.setAccessible(true);
            Object num = getRandom.invoke(null);

            System.out.println(obj);
            System.out.println(SingleTon.getInstance());


            System.out.println(num);
            System.out.println(SingleTon.getRandom());



        } catch (Exception e) {
            e.printStackTrace();
        }



    }


}
